#pragma once

constexpr auto MSG_ID_LEN = 2;
constexpr auto MSG_DATA_LEN = 8;
constexpr auto FILE_CHUNK_SIZE = 1024;
constexpr auto MSG_HEADER_LEN = MSG_ID_LEN + MSG_DATA_LEN;
constexpr auto MSG_MAX_DATA_LEN = 4096;

constexpr auto MAX_QUEUE_SIZE = 20480;

// MsgNode 的 msgId 类型
enum class MsgType {
	TYPE_TEXT = 1,
	TYPE_FILE // 文件类型

};

// 文件的类型，在包的json的type部分设置，如果发生错误，则会使用下面的文件错误类型
enum class FileType {
	TYPE_ERROR = 0,
	// 获取文件列表
	TYPE_GET_FILE_TREE,
	TYPE_GET_FILE_TREE_RESPONSE,
	TYPE_GET_FILE_TREE_FINISH,
	// 上传与下载
	TYPE_FILE_UPLOAD,
	TYPE_FILE_DOWNLOAD,
	TYPE_FILE_UPLOAD_RESPONSE,
	TYPE_FILE_DOWNLOAD_RESPONSE,
	TYPE_FILE_UPLOAD_STOP,
	TYPE_FILE_DOWNLOAD_STOP,
	TYPE_FILE_UPLOAD_RESPONSE_FINISH,
	TYPE_FILE_DOWNLOAD_RESPONSE_FINISH,
	// 断点续传
	TYPE_FILE_RETRY_UPLOAD,
	TYPE_FILE_RETRY_DOWNLOAD
};

enum class FileErrorType {
	UNKNOWN_ERROR = 0,
	FILE_NO_EXISTS,
	FILE_OPEN_FAIL,
	GET_FILE_TREE_ERROR
};
